package com.new2i.dao.impl;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.new2i.dao.able.EmrNeonatusDao;
import com.new2i.dao.mapper.EmrNeonatusMapper;
import com.new2i.model.EmrNeonatusEntity;

/**
 * 新生儿病历数据库操作实现类
 * 
 * @since 2015/09/04
 * @author 2i
 *
 */
@Repository("EmrNeonatusDao")
public class EmrNeonatusDaoImpl implements EmrNeonatusDao{

	@Autowired
	private EmrNeonatusMapper emrNeonatusMapper;
	
	@Override
	public EmrNeonatusEntity insertEmrNeonatus(EmrNeonatusEntity emr) {
		emrNeonatusMapper.insertEmrNeonatus(emr);
		return emr;
	}

	@Override
	public EmrNeonatusEntity updateEmrNeonatusById(EmrNeonatusEntity emr) {
		emrNeonatusMapper.updateEmrNeonatusById(emr);
		return emr;
	}

	@Override
	public List<HashMap<String, Object>> selectEmrListByUserId(int user_id, int doctor_id) {
		return emrNeonatusMapper.selectEmrListByUserId(user_id, doctor_id);
	}
	 
	@Override
	public List<HashMap<String,Object>> selectDoctorInfoListByUserId(int user_id) {
		return emrNeonatusMapper.selectDoctorInfoListByUserId(user_id); 
	}

	@Override
	public HashMap<String, Object> getEmrInfoById(int emr_neonatus_id) { 
		return emrNeonatusMapper.getEmrInfoById(emr_neonatus_id);
	}

	@Override
	public HashMap<String, Object> getTopEmrByDU(int doctor_id, int user_id) {
		return emrNeonatusMapper.getTopEmrByDU(doctor_id,user_id); 
	} 
}
